function kline(kdata){
	var myChart = echarts.init(document.getElementById('main'));
	var upColor = '#ec0000';
var upBorderColor = '#8A0000';
var downColor = '#00da3c';
var downBorderColor = '#008F28';

//数据意义：开盘(open)，收盘(close)，最低(lowest)，最高(highest)
var data0 = splitData(kdata);

function splitData(rawData) {
	var k1 = rawData.substring(2,rawData.length-2).split("],[")
	var k2 =[]
	for(var i =0;i<k1.length;i++){
		k2.push(k1[i].replace(/"/g,"").replace(/'/g,"").split(","));
	}
var categoryData = [];
var values = []
for (var i = 0; i < k2.length; i++) {
categoryData.push(k2[i].splice(0, 1)[0]);
values.push(k2[i])
}
return {
categoryData: categoryData,
values: values
};
}




option = {
tooltip: {
trigger: 'axis',
axisPointer: {
    type: 'cross'
}
},
grid: {
left: '4%',
right: '2%',
bottom: '16%'
},
xAxis: {
type: 'category',
data: data0.categoryData,
scale: true,
boundaryGap : false,
axisLine: {onZero: false},
splitLine: {show: false},
splitNumber: 20,
min: 'dataMin',
max: 'dataMax'
},
yAxis: {
scale: true,
splitArea: {
    show: true
}
},
dataZoom: [
{
    type: 'inside',
    start: 50,
    end: 100
},
{
    show: true,
    type: 'slider',
    y: '92%',
    start: 50,
    end: 100
}
],
series: [
{
    name: '日K',
    type: 'candlestick',
    data: data0.values,
    itemStyle: {
        normal: {
            color: upColor,
            color0: downColor,
            borderColor: upBorderColor,
            borderColor0: downBorderColor
        }
    },
    
    /*markPoint: {
        label: {
            normal: {
                formatter: function (param) {
                    return param != null ? Math.round(param.value) : '';
                }
            }
        },
        data: [
            
            {
                name: 'highest value',
                type: 'max',
                valueDim: 'highest'
            },
            {
                name: 'lowest value',
                type: 'min',
                valueDim: 'lowest'
            },
            {
                name: 'average value on close',
                type: 'average',
                valueDim: 'close'
            }
        ],
        tooltip: {
            formatter: function (param) {
                return param.name + '<br>' + (param.data.coord || '');
            }
        }
    },*/
    /*markLine: {
        symbol: ['none', 'none'],
        data: [
            [
                {
                    name: 'from lowest to highest',
                    type: 'min',
                    valueDim: 'lowest',
                    symbol: 'circle',
                    symbolSize: 10,
                    label: {
                        normal: {show: false},
                        emphasis: {show: false}
                    }
                },
                {
                    type: 'max',
                    valueDim: 'highest',
                    symbol: 'circle',
                    symbolSize: 10,
                    label: {
                        normal: {show: false},
                        emphasis: {show: false}
                    }
                }
            ],
            {
                name: 'min line on close',
                type: 'min',
                valueDim: 'close'
            },
            {
                name: 'max line on close',
                type: 'max',
                valueDim: 'close'
            }
        ]
    }*/
},

]
};
myChart.setOption(option);
	
}